﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BasicAppGrid.aspx.cs" Inherits="mapex.demo.AppGrid.BasicAppGrid" %>

<%@ Register TagPrefix="cnt" Namespace="Mysoft.Map.Application.Controls" Assembly="Mysoft.Map.Application.Components" %>
<%@ Register TagPrefix="mnu" Namespace="Mysoft.Map.Application.Menus" Assembly="Mysoft.Map.Application.Components" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <!--CSS-->
    <link rel="stylesheet" type="text/css" href="/_grid/map_grid.css" />
    <link rel="stylesheet" type="text/css" href="/_nav/menu.css" />
    <link rel="stylesheet" type="text/css" href="/_forms/styles/form.css" />
    <link rel="stylesheet" type="text/css" href="/_controls/find/find.css" />
    <link rel="stylesheet" type="text/css" href="/_common/styles/global.css" />

    <!--JS-->
    <script type="text/javascript" src="/_common/scripts/global.js"></script>
    <script type="text/javascript" src="/_controls/settings.aspx"></script>
    <script type="text/javascript" src="/_controls/util/util.js"></script>
    <script type="text/javascript" src="/_controls/datetime/date.js"></script>
    <script type="text/javascript" src="/_controls/number/number.js"></script>
    <script type="text/javascript" src="/_nav/menu.js"></script>

    <!--mapex-->
    <script type="text/javascript" src="/mapex/js/Map.Extensions.js"></script>
    <script type="text/javascript" src="/mapex/js/mapex.js"></script>

    <!--demo-->
    <link rel="stylesheet" type="text/css" href="/mapex/css/demo.css" />

    <script type="text/javascript">
        MJQ(function () {
            //定义删除方法
            appGrid.ex.addCommand("delete", function (oids, rows) {
                //选中行的所有信息都在oids、rows两个参数中了。如果位选中行，则不会调用到此函数。
                alert("oids:" + oids);
                for (var i = 0; i < rows.length; i++) {
                    alert(rows[i].oid);
                }
                //用户实现删除逻辑

            }, {
                confirm: true
            });

            //循环TR行数据
            appGrid.ex.addCommand("showRows", function () {
                appGrid.ex.eachRows(function (tr) {
                    //alert(tr.oid);
                });
            });

            //列表新增功能写法
            appGrid.ex.addCommand("add", function () {
                alert("这里实现弹出新增编辑页面逻辑。");
            });

            
            //菜单插入内容
            appGridMenu.ex.appendBeforeMenu('<input type="text" style="width:200px;" value="初始化自动插入的文本框" />');
            //修改Menu标题
            appGridMenu.ex.setTitle("被改变的菜单名称");
        });
    </script>


</head>
<body>
    <form id="form1" runat="server">
    </form>
    <table class="layout">
        <tr>
            <td class="appMenu">
                <mnu:AppGridMenu id="appGridMenu" runat="server" />
            </td>
        </tr>
        <tr>
            <td>
                <cnt:AppGrid id="appGrid" runat="server" multiselect="true" Filter="<filter/>" />
            </td>
        </tr>
    </table>
</body>
</html>
